<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>11_margin的注意事项2</title>
    <style>
      .box {
        width: 200px;
        height: 200px;
      }

      .box1 {
        background-color: skyblue;
      }

      .box2 {
        background-color: orange;
        margin: 10px auto;
      }

      .box3 {
        background-color: green;
      }

      img {
        width: 100px;
        height: 100px;
      }
    </style>
  </head>
  <body>
    <!-- 上margin，左margin会影响自身的位置，下margin，右margin会影响兄弟元素的位置 -->
    <div class="box box1">1</div>
    <div class="box box2">2</div>
    <div class="box box3">3</div>
    <hr />
    <img src="../../imgs/a.jpeg" alt="" />
    <img src="../../imgs/a.jpeg" alt="" />
    <img src="../../imgs/a.jpeg" alt="" />
  </body>
</html>
